#ifndef __ConfigManager_H__
#define __ConfigManager_H__
#include "json/rapidjson.h"
#include "json/document.h"
#include "cocos2d.h"
USING_NS_CC;
#include "ConfigBase.h"
using namespace std;

class CConfigManager
{
public:
	CConfigManager();
	~CConfigManager();

	static CConfigManager* getInstance();
	void destroy();

	template <class T>
	T getData(const string& strKey)
	{
		map<string, CConfigManagerBase*>::iterator iter = m_mapManager.find(strKey);
		if (iter != m_mapManager.end())
		{
			return static_cast<T>(iter->second);
		}
		return nullptr;
	};
	CConfigManagerBase* getData(const string& strKey);
	void setData(string strKey, CConfigManagerBase* pManager);


private:
	static CConfigManager* m_pInstance;
	map<string, CConfigManagerBase*> m_mapManager;
};

#endif
